package com.eastfair.venuebooking.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.eastfair.annotation.annotation.vo.VoInfo;
import com.eastfair.core.base.entity.Entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import com.eastfair.venuebooking.demand.QuotationGroup;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import static com.eastfair.core.utils.DateUtils.DEFAULT_DATE_TIME_FORMAT;
import com.eastfair.annotation.model.EchoVO;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 报价书
 * </p>
 *
 * @author linan
 * @since 2022-06-08
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("vb_quotation")
@ApiModel(value = "Quotation", description = "报价书")
@AllArgsConstructor
public class Quotation extends Entity<Long> implements EchoVO {

    private static final long serialVersionUID = 1L;
    @TableField(exist = false)
    private Map<String, Object> echoMap = new HashMap<>();
    /**
     * 是否启用：1是；0否
     */
    @ApiModelProperty(value = "是否启用：1是；0否")
    @TableField(value = "is_enabled")
    @Excel(name = "是否启用：1是；0否")
    private Integer isEnabled;

    /**
     * 是否删除：1是；0否
     */
    @ApiModelProperty(value = "是否删除：1是；0否")
    @TableField(value = "is_deleted")
    @Excel(name = "是否删除：1是；0否")
    private Integer isDeleted;

    /**
     * 项目id
     */
    @ApiModelProperty(value = "项目id")
    @TableField(value = "project_id")
    @Excel(name = "项目id")
    private Long projectId;

    /**
     * 子系统id
     */
    @ApiModelProperty(value = "子系统id")
    @TableField(value = "subsystem_id")
    @Excel(name = "子系统id")
    private Long subsystemId;

    /**
     * 租户id
     */
    @ApiModelProperty(value = "租户id")
    @TableField(value = "tenant_id")
    @Excel(name = "租户id")
    private Long tenantId;

    /**
     * 商机id
     */
    @ApiModelProperty(value = "商机id")
    @TableField(value = "opportunity_id")
    @Excel(name = "商机id")
    private Long opportunityId;

    /**
     * 展会
     */
    @ApiModelProperty(value = "展会")
    @TableField(value = "exhibition_id")
    @Excel(name = "展会")
    private Long exhibitionId;

    /**
     * 价目ID
     */
    @ApiModelProperty("价目ID")
    @TableField(value = "price_list_id")
    private Long priceListId;

    /**
     * 场地保证金
     */
    @ApiModelProperty(value = "场地保证金")
    @NotNull(message = "请填写场地保证金")
    @TableField(value = "splace_bond_amount")
    @Excel(name = "场地保证金")
    private BigDecimal splaceBondAmount;

    /**
     * 服务保证金
     */
    @ApiModelProperty(value = "服务保证金")
    @TableField(value = "service_bond_amount")
    @Excel(name = "服务保证金")
    private BigDecimal serviceBondAmount;

    /**
     * 总金额（折扣前）
     */
    @ApiModelProperty(value = "总金额（折扣前）")
    @TableField(value = "total_amount")
    @Excel(name = "总金额（折扣前）")
    private BigDecimal totalAmount;

    /**
     * 折扣场地服务
     */
    @ApiModelProperty(value = "场地费用")
    @TableField(value = "space_amount")
    @Excel(name = "场地费用")
    private BigDecimal spaceAmount;

    /**
     * 折扣后总价
     */
    @ApiModelProperty(value = "折扣后总价")
    @TableField(value = "discount_amount")
    @Excel(name = "折扣后总价")
    private BigDecimal discountAmount;

    /**
     * 计价单位(数据字典)
     */
    @ApiModelProperty(value = "计价单位(数据字典)")
    @Size(max = 255, message = "计价单位(数据字典)长度不能超过255")
    @TableField(value = "price_unit", condition = LIKE)
    @Excel(name = "计价单位(数据字典)")
    private String priceUnit;

    /**
     * 单位尺 1 时   2 天（“平米/天”，“每天对”应“天”    “平米/小时“，”每小时“对应”时“）
     */
    @ApiModelProperty(value = "单位尺 1 时   2 天（“平米/天”，“每天对”应“天”    “平米/小时“，”每小时“对应”时“）")
    @TableField(value = "unit_ruler")
    @Excel(name = "单位尺 1 时   2 天（“平米/天”，“每天对”应“天”    “平米/小时“，”每小时“对应”时“）")
    private Integer unitRuler;

    /**
     * 报价书标题
     */
    @ApiModelProperty(value = "报价书标题")
    @Size(max = 255, message = "报价书标题长度不能超过255")
    @TableField(value = "quotation_title", condition = LIKE)
    @Excel(name = "报价书标题")
    private String quotationTitle;


    @Builder
    public Quotation(Long id, Long createdBy, LocalDateTime createTime, Long updatedBy, LocalDateTime updateTime, 
                    Integer isEnabled, Integer isDeleted, Long projectId, Long subsystemId, Long tenantId, 
                    Long opportunityId, Long exhibitionId, BigDecimal splaceBondAmount, BigDecimal serviceBondAmount, BigDecimal totalAmount, BigDecimal discountAmount, 
                    String priceUnit, Integer unitRuler, String quotationTitle) {
        this.id = id;
        this.createdBy = createdBy;
        this.createTime = createTime;
        this.updatedBy = updatedBy;
        this.updateTime = updateTime;
        this.isEnabled = isEnabled;
        this.isDeleted = isDeleted;
        this.projectId = projectId;
        this.subsystemId = subsystemId;
        this.tenantId = tenantId;
        this.opportunityId = opportunityId;
        this.exhibitionId = exhibitionId;
        this.splaceBondAmount = splaceBondAmount;
        this.serviceBondAmount = serviceBondAmount;
        this.totalAmount = totalAmount;
        this.discountAmount = discountAmount;
        this.priceUnit = priceUnit;
        this.unitRuler = unitRuler;
        this.quotationTitle = quotationTitle;
    }

}
